package cn.webrx;

import java.util.Calendar;

public class Str6 {
    public static void main(String[] args) {

        String ss1 = "日一二三四五六".split("")[0];
        System.out.println(ss1);
        char ss2 = "日一二三四五六".toCharArray()[3];
        System.out.println(ss2);
        System.out.println("日一二三四五六".charAt(3));
        System.out.println();

        int k = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
        System.out.println("星期"+ "日一二三四五六".charAt(k-1));
        System.out.println("hello-java1.8-java18".replace("java", "javascript"));

        System.out.println("hello-java1.8-java18".replaceAll("java", "javascript"));
        System.out.println("hello-java1.8-java18".replaceFirst("java", "javascript"));

        System.out.println("-".repeat(100));
        System.out.println("*".concat("java").toUpperCase().repeat(3));

        String s = "   hello world              ";
        System.out.println(s);
        System.out.println(s.length());
        System.out.println(s.trim());
        System.out.println(s.trim().length());
        System.out.println(s);

        System.out.println("***".replace('*', '#'));
        System.out.println("aaa-ccc-aaa".replace("aaa", "java"));
    }
}
